package container.set;

import java.util.Comparator;

/**
 *比较器对象
 * */
public class StudentComparator implements Comparator<Student>
{
    @Override
    public int compare (Student o1, Student o2)
    {
        if(o1.getStudentAge() > o1.getStudentAge())
            return 1;
        if(o1.getStudentAge() == o2.getStudentAge())
            return o1.getStudentName().compareTo(o2.getStudentName());
        return -1;
    }
}
